package com.zhongen.oa.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongen.common.security.service.PigUser;
import com.zhongen.common.security.util.SecurityUtils;
import com.zhongen.oa.entity.ProjectSubTaskEntity;
import com.zhongen.oa.entity.vo.ProjectSubTaskVo;
import com.zhongen.oa.mapper.ProjectSubTaskMapper;
import com.zhongen.oa.service.ProjectSubTaskService;
import org.springframework.stereotype.Service;

/**
 * 支线任务管理
 *
 * @author Code Generator
 * @date 2024-01-12 10:14:12
 */
@Service
public class ProjectSubTaskServiceImpl extends ServiceImpl<ProjectSubTaskMapper, ProjectSubTaskEntity>
		implements ProjectSubTaskService {

	@Override
	public IPage<ProjectSubTaskVo> getProjectSubTaskPage(Page page, ProjectSubTaskEntity projectSubTask) {
		return baseMapper.getProjectSubTaskPage(page, projectSubTask);
	}

	@Override
	public IPage<ProjectSubTaskVo> getProjectSubTaskPageApp(Page page, ProjectSubTaskEntity projectSubTask) {
		if(projectSubTask.getCommander()!=null){
			PigUser loginUser = SecurityUtils.getUser();
			projectSubTask.setCommander(loginUser.getId());
		}
		return baseMapper.getProjectSubTaskPageApp(page, projectSubTask);
	}

}
